﻿using System;
using Vowei.Core.Models;
using Vowei.Data;
using Vowei.Data.Models;
using System.Web;
using Autofac;
using Vowei.Data.Helpers;
using System.Web.Mvc;

namespace Vowei.Web.Models
{
    class GenericWizardStep : IWizardStep
    {
        public object State { get; set; }

        public ActionResult Result { get; set; }

        public GenericWizardStep PreviousStep { get; set; }

        public GenericWizardStep NextStep { get; set; }

        private Func<GenericWizardStep, ActionResult> _func;

        public GenericWizardStep(Func<GenericWizardStep, ActionResult> func)
        {
            _func = func;
        }

        public IWizardStep Next()
        {
            Result = _func(this);
            return NextStep;
        }
    }

    //class GenericWizardStep2 : IWizardStep2
    //{
    //    public ActionResult Result { get; private set; }

    //    public GenericWizardStep2 PreviousStep { get; set; }

    //    public GenericWizardStep2 NextStep { get; set; }

    //    private Func<IWizardStepState, ActionResult> _func;

    //    public GenericWizardStep2(Func<IWizardStepState, ActionResult> func)
    //    {
    //        _func = func;
    //    }

    //    public void Do(IWizardStepState state)
    //    {
    //        Result = _func(state);
    //    }
    //}

    //class WizardStepState : IWizardStepState
    //{
    //    public IWizardController Owner { get; set; }

    //    public IVoweiContext DataContext { get; set; }

    //    public IUser CurrentUser { get; set; }

    //    public object AdditionalState { get; set; }
    //}
}